package org.example.demo3.enity;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.example.demo3.enums.ProductConditionEnum;
import org.example.demo3.enums.ProductTypeEnum;

import java.util.List;

@Data
public class ProductDTO {
    //商品标题
    @NotBlank(message = "商品标题必填")
    private String title;
    //商品描述
    @NotNull(message = "商品描述")
    private String description;
    //价格
    @NotNull(message = "价格不能为空")
    @DecimalMin(value = "0.01", message = "价格需大于0")
    private Double price;
    //商品成色
    @NotNull(message = "成色等级必选")
    private ProductConditionEnum condition;
    //发布者id
    @NotNull(message = "发布者id不能为空")
    private Integer userId;

    //商品图片url数组
    @NotNull(message = "至少上传一张图片")
    private List<String> images;
    //分类类型
    @NotNull(message = "分类类型不能为空")
    private ProductTypeEnum type;
    //创建时间
    private String createTime;
    //分类名称
    private String typeName;

}